package com.shangxian.giveithome.controller;


import com.shangxian.giveithome.result.Result;
import com.shangxian.giveithome.service.AttentionService;
import com.shangxian.giveithome.service.MyCommunityService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/MyCommunity")
public class MyCommuntiryController {

    @Autowired
    private MyCommunityService myCommunityService;

    @Autowired
    private AttentionService attentionService;


    @GetMapping("/findIssueUserMessige")
    @ApiOperation("查看用户社区的个人信息")
    public Result findMine(@RequestParam(value = "id",required = false)Long id , HttpServletRequest request){
        return Result.success(myCommunityService.findIssueUserMessige(request,id));
    }


    @GetMapping("/findAttentionCollectionUserMessage")
    @ApiOperation(value = "查询用户合集详情页面的用户信息")
    public Result findAttentionCollectionUserMessage(@RequestParam("id")Long id,  HttpServletRequest request){
        return Result.success(attentionService.findAttentionCollectionUserMessage(id,request));
    }


}
